UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PmBGLXDb6FACBRXBBniKl2YzD9Pb0UA0rrHrQ5y9R64='
WHERE
key_id = '12eb4b2809b9cc198f021fa723fa74a2bbe568fb01e76406215a36abbb371143'
AND (
token = 'PmBGLXDb6FACBRXBBniKl2YzD9Pb0UA0rrHrQ5y9R64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)