UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Eupx3QeGfSZa8U4zY9bxKHvSdc2pbwfmueY5YIgXpw=' 
WHERE 
  key_id = '881ff04fcb57599bc6403271a3d33c84fe70acd0dcd0db17b0ab3f840e8fcba1' 
  AND (
    token = '4Eupx3QeGfSZa8U4zY9bxKHvSdc2pbwfmueY5YIgXpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035