UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Mr6Kwapiyhd7cauDx34Uq9oKU6QN4uvk+Pj+OCcxfA='
WHERE
key_id = '198ef5dcbf4f9a5d36500d98c1c977937bb950c4ebf3dcbd1464d08f96fb65eb'
AND (
token = '3Mr6Kwapiyhd7cauDx34Uq9oKU6QN4uvk+Pj+OCcxfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)