UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wdx1X0aF4nncDbiLri+i4FXAZCXoq8UrBKLn857BuIw='
WHERE
key_id = '2a11a7b0a3c02edd317fed8da326a5b78d65d76e432a5bd8798b924379c375ef'
AND (
token = 'wdx1X0aF4nncDbiLri+i4FXAZCXoq8UrBKLn857BuIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)