UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nno9i7GL8NZN/V4i+wvkt7WFLvLK1i2v5INayDLGYG0='
WHERE
key_id = 'e804233edfaec39a241d6a5af659d1b811f5bdc2752df0fccb5169ea9e3a0981'
AND (
token = 'Nno9i7GL8NZN/V4i+wvkt7WFLvLK1i2v5INayDLGYG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)