UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ks9OehR+A2XFUKlV9Tn7IKr3XrzKzL4h3nrM8ZGPDLY='
WHERE
key_id = '9c9063caa517bf7d921878dd5a2a0811fed49844e5bc138362f34bfc639dda11'
AND (
token = 'ks9OehR+A2XFUKlV9Tn7IKr3XrzKzL4h3nrM8ZGPDLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)