UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L3G1oWs3llvCeg7PGw4JqJb2NcWo8Pjbp4yhzIP6tHI=' 
WHERE 
  key_id = '05a1f585b44bd891dd9f94a31f5481650f23f70d051286e592e507c7eb0ead88' 
  AND (
    token = 'L3G1oWs3llvCeg7PGw4JqJb2NcWo8Pjbp4yhzIP6tHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047