UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eFphYNUu53FVDIyHn+xlT47V6CibvG5srKC/MRED8qY='
WHERE
key_id = 'f216f626d66198bf98744458b1c696139a5f64b7dd9baf8916f3bb2b6a363e3b'
AND (
token = 'eFphYNUu53FVDIyHn+xlT47V6CibvG5srKC/MRED8qY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)