UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z5GcGHSff9UvHAclM3o9qaOj+nxnM5G/nqLIU4wW+KM='
WHERE
key_id = 'f0e2c672d3ac82493e10b84bb749918bb6153a6e1a27744da0679d8ddc836162'
AND (
token = 'Z5GcGHSff9UvHAclM3o9qaOj+nxnM5G/nqLIU4wW+KM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)