UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VdOW5cWUb4q5pvXpyz67oxSzhZ0jrJBXXYA5wr+jH+0=' 
WHERE 
  key_id = '97c68d0641831c4350fa0154866c8c91ecb57c8cd503c2d6616a3e87bd892426' 
  AND (
    token = 'VdOW5cWUb4q5pvXpyz67oxSzhZ0jrJBXXYA5wr+jH+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023