UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLC34dN2gA2eHRxWMLcoQy/xt/DVtTZMYls8zSxynOE='
WHERE
key_id = '19b043b2db85f338ee380f573ee7aeb3ecb10a9e71b656d03534a282b14af033'
AND (
token = 'nLC34dN2gA2eHRxWMLcoQy/xt/DVtTZMYls8zSxynOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)