UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hipjJbvNB7ySHmSRlNBacYJLo/jyP96ETlFLoPiTvJA='
WHERE
key_id = '06cf161b19a02ceb16f868fb3b581f94e3cdf943cf9fad555b1d5ea4badcf3ec'
AND (
token = 'hipjJbvNB7ySHmSRlNBacYJLo/jyP96ETlFLoPiTvJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)