UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IRN8A+4i2A3K8vI9YjlJZFIuBEavHicQuUf0biSTerM='
WHERE
key_id = 'e2235ba282033487c00fbd19a8ad09a9fc55ae4cda4f2a0754236eaee0e60209'
AND (
token = 'IRN8A+4i2A3K8vI9YjlJZFIuBEavHicQuUf0biSTerM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)