UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+OWqIbhuvBtt5V9uQJrd9U2bDwyRF3UXqQ8CchuU/W4=' 
WHERE 
  key_id = '95a22a2a337a3353381c101ce4fc379a42ca3fa563d5f20d7df9873279da93b5' 
  AND (
    token = '+OWqIbhuvBtt5V9uQJrd9U2bDwyRF3UXqQ8CchuU/W4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031