UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DGcQfXUiDSqMjy7UWAfyySRttW0zZ5xnCARpNtLkyzQ='
WHERE
key_id = '53aced63a2b99df5317d5750b3f53c6cb1bff77e73d67ea936bda0ff4f234c78'
AND (
token = 'DGcQfXUiDSqMjy7UWAfyySRttW0zZ5xnCARpNtLkyzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)