UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uoqhMwLDzOvTnH5dXHEamNLDeTq4HGFiAlbtLZYV1BQ='
WHERE
key_id = 'bc661db76181e923d5938a5b6dcbac933349661ac223e641b6aa28c9dca63cbf'
AND (
token = 'uoqhMwLDzOvTnH5dXHEamNLDeTq4HGFiAlbtLZYV1BQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)