UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcWbI0afDFF50JsOY5FxCKEDNpzDH2hKAy2+sZx4CJ4='
WHERE
key_id = '09f4d1d1063eeed68c50aa6bc53ee46093c351008aada211406fc6eddfa7ac57'
AND (
token = 'wcWbI0afDFF50JsOY5FxCKEDNpzDH2hKAy2+sZx4CJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)