UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VOIyYGEeYvZ0/NlPP1snDwakkFdtj47yy67x5st+52g=' 
WHERE 
  key_id = '15f53f0761ab7c73d279362aaf48a9ffedf8b4fbb110a6e2e28d4c1143dd745e' 
  AND (
    token = 'VOIyYGEeYvZ0/NlPP1snDwakkFdtj47yy67x5st+52g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046