UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eh3grSDMVDrIP2qcikNp0h8HaKtNGynjOjIdOcBHDgk='
WHERE
key_id = '03ecab52408ceff729555ddab1b412f0de29a1f10994fe8eb1bccb617037ffb6'
AND (
token = 'eh3grSDMVDrIP2qcikNp0h8HaKtNGynjOjIdOcBHDgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)