UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HLjwgjLf2+ebqgfw0pCok3kZqag3gJU8heImqO7XnOQ='
WHERE
key_id = '113d5dbf8c7605eff19a9e3aa250372ae4f2978a5959296536349b8fc26659dd'
AND (
token = 'HLjwgjLf2+ebqgfw0pCok3kZqag3gJU8heImqO7XnOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)