UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvcSEo6z7d8ex0AZZWou/CpMkYcx1iPB/ARy+G0XiVA='
WHERE
key_id = 'a579bd13de404d8847a217f9d2145af7c0027a8311abfe179a1453de538fe534'
AND (
token = 'yvcSEo6z7d8ex0AZZWou/CpMkYcx1iPB/ARy+G0XiVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)