UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S4M0SwsZDpteAODigA9RdEZ5gUA/5/70Ct0SmWOW+2E='
WHERE
key_id = '0b48aad445b72efbc7f80b18030c2305613218ccd8c0a2c1cc249752b782655c'
AND (
token = 'S4M0SwsZDpteAODigA9RdEZ5gUA/5/70Ct0SmWOW+2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)