UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f5PMUOdnosM83Tfd7t/bMNAhylThOSEl9Y3L3eqc+Eg='
WHERE
key_id = 'd5d29b0561043c062801ac657c914472bd1d79134aa0a6a5977bed26aac67cf8'
AND (
token = 'f5PMUOdnosM83Tfd7t/bMNAhylThOSEl9Y3L3eqc+Eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)