UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'njHwp2E/96p0QJVVQbl1Re0Md7TAqIgZAkjf6diw6l8='
WHERE
key_id = '6b530a15b7e8640acc9d6276e06c5ba90bd3ff7080310bea905cbd325568a542'
AND (
token = 'njHwp2E/96p0QJVVQbl1Re0Md7TAqIgZAkjf6diw6l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)