UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'blx5onw4m/3uIspZZL0sSqRoQxRGxydaZX52BR03CoE='
WHERE
key_id = 'd71391c3df3cf0db75f9a383056ebeeaf692086ff2f4cea92b688a861451c3c9'
AND (
token = 'blx5onw4m/3uIspZZL0sSqRoQxRGxydaZX52BR03CoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)