UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qViAyQtj8RsnjwL1ENjnr5esDUN5RbbNjZqdT4SHLvk='
WHERE
key_id = '82b6359e1e358c0eb05634445befabfd630c2205c4e5ece61f2691375fa27a0d'
AND (
token = 'qViAyQtj8RsnjwL1ENjnr5esDUN5RbbNjZqdT4SHLvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)