UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KxDvXTwRNZc2CRwCJzFFGLDw2nK4/Cywl0JwZ6gL+g8=' 
WHERE 
  key_id = '62fbc49b0c914a02e322bdad24ef196e68c76a3f1329daf2a6f6b7ed9088dfd1' 
  AND (
    token = 'KxDvXTwRNZc2CRwCJzFFGLDw2nK4/Cywl0JwZ6gL+g8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035