UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rn5quHneD7qAOaPrjP6ZnJSMwJ32+kyW4Qp4QUkFdqI='
WHERE
key_id = '2287ce26e49715706ce9e013c90f3bcce5f961f71dd8bdea3c94e24f049d6c53'
AND (
token = 'rn5quHneD7qAOaPrjP6ZnJSMwJ32+kyW4Qp4QUkFdqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)