UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd7l3ru97/oxCGyy2WBJvmBUROAML2kumewbu/VjM67M='
WHERE
key_id = 'd219cd65fa010cd7c0059bd77c111e1f38c670ab550801ed8af179cd5a0ccf9c'
AND (
token = 'd7l3ru97/oxCGyy2WBJvmBUROAML2kumewbu/VjM67M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)