UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5R2js3fEmO09xM4PcEmeTXbzae49V1PbzEinsqWKQYM='
WHERE
key_id = '602ef7694eb7769ddb86efab015591b69d1305d370054be4dba4517f87a2327b'
AND (
token = '5R2js3fEmO09xM4PcEmeTXbzae49V1PbzEinsqWKQYM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)